package com.controller;

import com.entity.Doctor;
import com.entity.Result;
import com.service.DoctorService;
import com.service.PatientService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@SuppressWarnings({"all"})
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/doctor")
public class DoctorController {

    @Resource
    private DoctorService doctorService;

    @PostMapping("/login")
    public Result login(Doctor doctor){
        System.out.println("进入login控制器："+doctor);
        try {
            return Result.success(doctorService.login_doctor(doctor));
        } catch (Exception e) {
            return Result.error(doctorService.login_doctor(doctor));
        }
    }
}
